public class 二进制 {
    public static void main(String[] args) {
        binaryToDecimal(8);
    }

    public static void binaryToDecimal(int n){
        String str = "";
        while (n!=0){
            str = n%2+str;
            n = n/2;
        }
        System.out.println(str);
    }
}
